﻿package com.shuqi.activity.viewport;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewParent;
import android.widget.TextView;

public class MarqueeTextView extends TextView {

    public MarqueeTextView(Context context) {
        super(context);
    }

    public MarqueeTextView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public MarqueeTextView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    public boolean isFocused() {
        return true;// 返回true，任何时候都处于focused状态，就能跑马
    }

    public void setPressed(boolean pressed) {
        ViewParent parent = getParent();

        if (pressed && parent != null && parent instanceof View && ((View) parent).isPressed()) {
            return;
        }
        super.setPressed(pressed);

    };
}
